<?php $this->load->view('common/admin_header');?>
<div class="block">
  <div class="block_head">
    <div class="bheadl"></div>
    <div class="bheadr"></div>
    <h2><?=$lang['content_lable_7']?></h2>
  </div>
  <!-- .block_head ends -->
  <div class="block_content">
    <p class="breadcrumb"><?=$lang['global_lable_14']?> &raquo; <a href="<?=site_url('admins/index')?>"><?=$lang['global_lable_11']?></a> &raquo; <?=$lang['content_lable_1']?> &raquo; <strong><?=$lang['content_lable_7']?></strong></p>
    <?php $this->load->view('common/notify');?>
    <form action="<?=site_url('admins/logoimg')?>" method="get">
      <input type="hidden" name="field" value="<?=isset($field)?$field:'n.sort_order'?>" id="field">
      <input type="hidden" name="sort_order" value="<?=isset($sort)?$sort:'asc'?>" id="sort_order">
      <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
        <thead>
          <tr class="list_head">
            <th><input type="checkbox" name="chk_all" id="chk_all"></th>
            <!-- <th><a id="id" class="<?=isset($field) && $field=='id'?$sort:'';?>" href="#"><?=lang('cart_number')?></a></th> -->
            <th><?=$lang['content_lable_16']?></th>
            <!-- <th><a id="category" class="<?=isset($field) && $field=='category'?$sort:'';?>" href="#">所屬頁面</a></th> -->
            <!-- <th><a id="position" class="<?=isset($field) && $field=='position'?$sort:'';?>" href="#">所屬位置</a></th> -->
            <th style="width: 150pt;"><a id="title" class="<?=isset($field) && $field=='title'?$sort:'';?>" href="#"><?=$lang['content_lable_11']?></a></th>
            <th><a id="url" class="<?=isset($field) && $field=='bg_color'?$sort:'';?>" href="#"><?=$lang['content_lable_17']?></a></th>
            <th><a id="sort_order" class="<?=isset($field) && $field=='sort_order'?$sort:'';?>" href="#"><?=$lang['global_lable_17']?></a></th>
            <th><a id="status" class="<?=isset($field) && $field=='status'?$sort:'';?>" href="#"><?=$lang['global_lable_16']?></a></th>
            <th style="text-align:center"><?=$lang['global_lable_21']?></th>
          </tr>
          <tr class="list_tool">
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <!-- <td>
               <select name="category">
                  <option value=''>--請選擇所屬頁面--</option>
                  <?php foreach($ccc as $k=>$c):?>
                  <option value='<?=$k?>' <?php echo set_select('category',$k);?> <?=isset($category) && $category==$k?'selected':''?>><?=$c?></option>
                  <?php endforeach;?>
                </select>
            </td>
            <td>
                <select name="position">
                  <option value=''>--請選擇選擇位置--</option>
                  <?php foreach($positions as $k=>$p):?>
                  <option value='<?=$k?>' <?php echo set_select('position',$k);?> <?=isset($position) && $position==$k?'selected':''?>><?=$p?></option>
                  <?php endforeach;?>
                </select>
            </td>
            -->
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td style="text-align:center">
              <input type="submit" class="btn btn-small btn-primary" name="sub_filter" value="<?=$lang['global_lable_22']?>"/>
              <a href="<?=site_url('admins/logoimg/add')?>" class="btn btn-small btn-danger"><i class="icon-plus"></i> <?=$lang['global_lable_23']?></a>
            </td>
          </tr>
        </thead>
        <tbody class="table">
          <?php $CI=& get_instance();?>
          <?php if(isset($lists_count) && $lists_count>0):?>
          <?php foreach($lists->result_array() as $list):
              $list_id=$list['id'];
              $page_tag=$list['category'];
              $thumb_img=isset($list['logo']) && file_exists($list['logo'])?Imagelib::resize_thumb($list['logo'],100,50):'themes/admins/img/noimage.png';
              $list_url=site_url("admins/logoimg/%s/$list_id");
              $status=$list['status']==1?$lang['global_lable_37']:$lang['global_lable_38'];
              $category_string=$CI->get_categorys($list['category']);
              $position_string=$CI->get_position($list['position']);
            ?>
          <tr>
            <td><input type="checkbox" class="chk_one"  value="<?=$list['id']?>"></td>
            <td><img src="<?=base_url().$thumb_img?>" /></td>
            <!--<td><?=$category_string?></td>
            <td><?=$position_string?></td>-->
            <td><?=$list['title']?></td>
            <td><?=$list['url']?></td>
            <td><?=$list['sort_order']?></td>
            <td><?=$status?></td>
            <td class="listaction">
              <a href="<?=sprintf($list_url,"edit");?>" class="l_edit"><?=$lang['global_lable_24']?></a>
              <a href="javascript:void(0);" onClick="delete_item('<?=sprintf($list_url,"delete")?>');" class="l_delete"><?=$lang['global_lable_25']?></a></td>
          </tr>
          <?php endforeach;?>
          <?php else:?>
          <tr>
            <td colspan="19" class="nodata"><p><?=$lang['global_lable_42']?></p></td>
          </tr>
          <?php endif;?>
        </tbody>
      </table>
      <p>
        <input type="button" class="btn small" onclick="delete_allitem('<?=site_url('admins/logoimg/delete_batch')?>')" value="<?=$lang['global_lable_28']?>"/>
      </p>
      <!-- .tableactions ends -->
      <div id="pagination"><?php echo $pagination;?><div class="listscount"><?=$lang['global_lable_29']?> <?=$lists_count?> <?=$lang['global_lable_30']?></div></div>
      <!-- .pagination ends -->
    </form>
  </div>
  <!-- .block_content ends -->
  <div class="bendl"></div>
  <div class="bendr"></div>
</div>
<?php $this->load->view('common/admin_footer');?>
